import '../line_style.dart';
import 'series.dart';

import 'package:json_annotation/json_annotation.dart';

part 'parallel_series.g.dart';

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class ParallelEmphasis {
  LineStyle? lineStyle;

  ParallelEmphasis({this.lineStyle});

  factory ParallelEmphasis.fromJson(Map<String, dynamic> json) =>
      _$ParallelEmphasisFromJson(json);

  Map<String, dynamic> toJson() => _$ParallelEmphasisToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class ParallelData {
  var name;
  var value;
  var lineStyle;
  var color;
  var width;
  var type;
  var dashOffset;
  var cap;
  var join;
  var miterLimit;
  var shadowBlur;
  var shadowColor;
  var shadowOffsetX;
  var shadowOffsetY;
  var opacity;

  ParallelEmphasis? emphasis;

  ParallelData(
      {this.name,
      this.value,
      this.lineStyle,
      this.color,
      this.width,
      this.type,
      this.dashOffset,
      this.cap,
      this.join,
      this.miterLimit,
      this.shadowBlur,
      this.shadowColor,
      this.shadowOffsetX,
      this.shadowOffsetY,
      this.opacity,
      this.emphasis});

  factory ParallelData.fromJson(Map<String, dynamic> json) =>
      _$ParallelDataFromJson(json);

  Map<String, dynamic> toJson() => _$ParallelDataToJson(this);
}

@JsonSerializable(includeIfNull: false, explicitToJson: true)
class ParallelSeries extends Series {
  var type = 'parallel';
  var id;

  var coordinateSystem;
  var parallelIndex;
  var name;

  LineStyle? lineStyle;

  ParallelEmphasis? emphasis;

  var inactiveOpacity;
  var activeOpacity;
  var realtime;
  var smooth;
  var progressive;
  var progressiveThreshold;
  var progressiveChunkMode;
  List<ParallelData>? data;

  var zlevel;
  var z;
  var silent;
  var animation;
  var animationThreshold;
  var animationDuration;
  var animationEasing;
  var animationDelay;
  var animationDurationUpdate;
  var animationEasingUpdate;
  var animationDelayUpdate;

  ParallelSeries(
      {this.id,
      this.coordinateSystem,
      this.parallelIndex,
      this.name,
      this.lineStyle,
      this.emphasis,
      this.inactiveOpacity,
      this.activeOpacity,
      this.realtime,
      this.smooth,
      this.progressive,
      this.progressiveThreshold,
      this.progressiveChunkMode,
      this.data,
      this.zlevel,
      this.z,
      this.silent,
      this.animation,
      this.animationThreshold,
      this.animationDuration,
      this.animationEasing,
      this.animationDelay,
      this.animationDurationUpdate,
      this.animationEasingUpdate,
      this.animationDelayUpdate});

  factory ParallelSeries.fromJson(Map<String, dynamic> json) =>
      _$ParallelSeriesFromJson(json);

  Map<String, dynamic> toJson() => _$ParallelSeriesToJson(this);
}
